/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hera.process.security.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author cmontes
 */
@Embeddable
public class SecGroupModulePK implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = -3574373978752039353L;
	@Basic(optional = false)
    @Column(name = "ID_SECURITY_GROUP")
    private Long idSecurityGroup;
    @Basic(optional = false)
    @Column(name = "ID_MODULE")
    private Long idModule;

    public SecGroupModulePK() {
    }

    public SecGroupModulePK(Long idSecurityGroup, long idModule) {
        this.idSecurityGroup = idSecurityGroup;
        this.idModule = idModule;
    }

    public Long getIdSecurityGroup() {
        return idSecurityGroup;
    }

    public void setIdSecurityGroup(Long idSecurityGroup) {
        this.idSecurityGroup = idSecurityGroup;
    }

    public Long getIdModule() {
        return idModule;
    }

    public void setIdModule(Long idModule) {
        this.idModule = idModule;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSecurityGroup != null ? idSecurityGroup.hashCode() : 0);
        hash += (idModule != null ? idModule.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        
        if (!(object instanceof SecGroupModulePK)) {
            return false;
        }
        SecGroupModulePK other = (SecGroupModulePK) object;
        if ((this.idSecurityGroup == null && other.idSecurityGroup != null) || (this.idSecurityGroup != null && !this.idSecurityGroup.equals(other.idSecurityGroup))) {
            return false;
        }
        if ((this.idModule == null && other.idModule != null) || (this.idModule != null && !this.idModule.equals(other.idModule))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hera.process.data.domain2.SecGroupModulePK[ idSecurityGroup=" + idSecurityGroup + ", idModule=" + idModule + " ]";
    }
    
}
